home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_a_d / cp_80a.zip / WWWMENUS.DL_ < prev    next >
Text File  |  1992-10-15  |  31KB  |  808 lines

  1. ; WWWMENUS.DLL
  2. ; Common menus used by WWW Products
  3.  
  4.     CancelCmd="Exit"
  5.     goto %param1%        ; Go immediately to desired section
  6.                          ; Defined sections are:
  7.                               ZIP
  8.                               UNZIP
  9.                               SYSINFO
  10.                               INIEDIT
  11.                               FONEBOOK
  12.                               DIRSIZE
  13.                               FILEINFO
  14.                               FREESPACE
  15.                               CMDSTACK
  16.                               PROGBUILD
  17.                               WALLPAPER
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19. :WALLPAPER
  20.            a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited?
  21.            if FileExtension(a)=="BMP" then goto walldoit
  22.            a=FileItemize("*.bmp")                ; No?  Any in Current Directory?
  23.            if a!="" then goto sel
  24.  
  25.            ; Hmmm cannot find any BMP in current dir.  Check INI/Prompt user for info
  26.            WallDir1=inireadpvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
  27.            :REASK
  28.            if WallDir1=="ASK" then WallDir=AskLine("WallPaper","What directory are your *.BMP WallPaper files in?",DirWindows(0))
  29.                               else WallDir=WallDir1
  30.            ErrorMode(@off)
  31.            DirChange(WallDir)
  32.            ErrorMode(@cancel)
  33.            a=FileItemize("*.BMP")
  34.            if a=="" then Message("WallPaper Error","No *.BMP files found in %WallDir%")
  35.                     then goto REASK
  36.            if WallDir!=WallDir1 then iniwritepvt("wallpaper","WallPaperDir",WallDir,"WWW-PROD.INI")
  37.  
  38.            :sel
  39.            a=strcat("-None- ",a)
  40.            a=ItemSelect("Select New Wallpaper",a," ")
  41.            terminate(a=="","Wallpaper","No wallpaper selected")
  42.            if a=="-None-" then Wallpaper("",0)
  43.                           then exit
  44.            a=strcat(DirGet(),a)
  45.            :walldoit
  46.            tile=@FALSE
  47.            if FileSize(a)<40000 then tile=@TRUE
  48.            ;if bmp size less than 40K, assume tile, else center
  49.            Wallpaper(a,tile)
  50.            drop(a,b,tile)
  51.            Exit
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. :PROGBUILD
  54.     ;Uses DDE to get ProgMan to divluge contents of groups and builds
  55.     ;CmdPost and File Commander menu items to match
  56.  
  57.     CancelCmd="goto cancelbuild"
  58.  
  59.     OldWinTitle=WinName()
  60.     WinTitle("","Prog Build Initializing")
  61.     f=0
  62.     Pause("Progman Capture","This menu item will rebuild this menu file%cr%with the current contents of ProgMan groups.%cr%It does take a few minutes, so be patient.")
  63.     ProgWho=""
  64.     If stricmp("FileCmdr",param2)==0 then ProgWho="FC"
  65.                                      then OldWinTitle="File Manager"
  66.     If stricmp("CmdPost",param2)==0  then ProgWho="CP"
  67.     Terminate(ProgWho=="","ProgBuild Menu Error","Param2 not CP or FC")
  68.  
  69.     LSP=""
  70.     if ProgWho=="CP" then newcpm = "cmdgroup.cpm"
  71.                      then LSP=" "
  72.     if ProgWho=="FC" then newcpm = "wwwfc4.mnu"
  73.     n=FileLocate(newcpm)
  74.     if n=="" then newcpm=strcat(DirWindows(0),newcpm)
  75.              else newcpm=n
  76.  
  77.     startpm = 0
  78.     channel = DDEInitiate("Progman", "Progman")
  79.     If channel != 0 Then Goto DDEOK
  80.     ; Hmmm DDE not working.  Check for Progman
  81.     If WinExist("Program Manager") then Goto TRY2
  82.     If !FileExist("progman.exe") then Message("ProgMan Capture","Cannot find PROGMAN.EXE")
  83.                                  then goto cancelbuild
  84.     RunHide("progman.exe", "")
  85.     startpm=1
  86.   :TRY2
  87.     channel = DDEInitiate("Progman", "Progman")
  88.     If channel == 0 Then Goto ddeerror
  89.   :DDEOK
  90.     groups = DDERequest(channel, "Groups")
  91.     If groups == "***NACK***" Then Goto ddeerror
  92.     groups = StrReplace(groups, cr, tab)
  93.     groups = ItemSort(groups, tab)
  94.     f = FileOpen(newcpm, "WRITE")
  95.     if ProgWho=="CP" then FileWrite(f,"&Groups")
  96.                      then FileWrite(f," Rebuild Menu from ProgMan Grps")
  97.                      then FileWrite(f,'        Call("wwwmenus.dll","PROGBUILD %%IniSection%%")')
  98.     if ProgWho=="FC" then FileWrite(f,"Rebuild Menu from ProgMan Grps")
  99.                      then FileWrite(f,'        Call("wwwmenus.dll","PROGBUILD %%IniSection%%")')
  100.     n = ItemCount(groups, tab)
  101.     i = 0
  102.  
  103.   :nextgroup
  104.     i = i + 1
  105.     group = ItemExtract(i, groups, tab)
  106.     If group == "" Then Goto DODANEXTONE
  107.     If group=="Quick Access" then goto DODANEXTONE
  108.  
  109.     FirstItem=0
  110.     if i==1 then GroupTitle=strcat(LSP,"_",group)
  111.             else GroupTitle=strcat(LSP,group)
  112.  
  113.     items = DDERequest(channel, group)
  114.     If items == "***NACK***" Then Goto DODANEXTONE
  115.     items = StrReplace(items, cr, tab)
  116.     items = ItemRemove(1, items, tab)
  117.     items = ItemSort(items, tab)
  118.  
  119.     o = ItemCount(items, tab)
  120.     j = 0
  121.   :nextitem
  122.     j = j + 1
  123.     item = ItemExtract(j, items, tab)
  124.     If item == "" Then Goto DODANEXTONE
  125.  
  126.     itemdesc = ItemExtract(1, item, ",")
  127.     itemdesc = StrSub(itemdesc, 2, StrLen(itemdesc) - 2)
  128.  
  129.     itemprog = StrLower(ItemExtract(2, item, ","))
  130.     itemprog = StrSub(itemprog, 2, StrLen(itemprog) - 2)
  131.     WinTitle("",`<Group %group% %i%/%n% : Item %itemprog% %j%/%o%>`)
  132.     itemparms = ""
  133.     sp1 = StrIndex(itemprog, " ", 1, @FWDSCAN)
  134.     If sp1 == 0 Then Goto noparms
  135.     itemparms = StrSub(itemprog, sp1 + 1, StrLen(itemprog) - sp1)
  136.     itemprog = StrSub(itemprog, 1, sp1 - 1)
  137.     :noparms
  138.  
  139.     itemdir = StrLower(ItemExtract(3, item, ","))
  140.  
  141.     ; Do HotKeys for CmdPost
  142.     hotkey = ""
  143.     if ProgWho!="CP" then goto nohotkey
  144.     itemkey = ItemExtract(8, item, ",")
  145.     If itemkey == "0" Then Goto nohotkey
  146.     hotkey = " \ "
  147.     If itemkey & 1024 Then hotkey = StrCat(hotkey, "!")
  148.     If itemkey & 512 Then hotkey = StrCat(hotkey, "^")
  149.     If itemkey & 256 Then hotkey = StrCat(hotkey, "+")
  150.     hotkey = StrCat(hotkey, Num2Char(itemkey & 255))
  151.     :nohotkey
  152.  
  153.     icon = ""
  154.     If ItemExtract(9, item, ",") == "1" Then icon = "Icon"
  155.  
  156.     if FirstItem==0 then FileWrite(f, GroupTitle)
  157.                     then FirstItem=1
  158.  
  159.     FileWrite(f, `%LSP% %itemdesc%%hotkey%`)
  160.     If itemdir != "" Then FileWrite(f, `       DirChange("%itemdir%")`)
  161.     FileWrite(f, `       Run%icon%("%itemprog%", "%itemparms%")`)
  162.     FileWrite(f, ``)
  163.  
  164.  
  165.     :DODANEXTONE
  166.     If j < o Then Goto nextitem
  167.     If i < n Then Goto nextgroup
  168.     Goto pbdone
  169.  
  170.     :error
  171.     Message("ProgMan Group Capture Error", "Operation unsuccessful")
  172.     Goto cancelbuild
  173.  
  174.     :ddeerror
  175.     Message("ProgMan Group Capture DDE Error", "Operation unsuccessful")
  176.     Goto cancelbuild
  177.  
  178.     :pbdone
  179.     Message("ProgMan Group Capture", "Processing complete%cr%Push OK and wait for menu reload.")
  180.  
  181.     :cancelbuild
  182.     if f!=0 then FileClose(f)
  183.     If IsDefined(channel) Then DDETerminate(channel)
  184.     If startpm == 1 Then WinClose("Program Manager")
  185.     WinTitle("",OldWinTitle)
  186.     Drop(newcpm, startpm, channel, f, i, j, n, o, groups, group, items, item)
  187.     Drop(itemdesc, itemprog, itemparms, itemdir, itemkey, hotkey, icon, sp1)
  188.     Drop(OldWinTitle,GroupTitle,FirstItem)
  189.     Reload()
  190.     Exit
  191. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  192. :CMDSTACK
  193.         ; CmdStack uses wierd variable names to reduce the chance that a user
  194.         ; will try to execute a statement using the same names!!
  195.         if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds=""
  196.         if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3"
  197.         goto %param2%
  198.  
  199.    :PREVIOUS
  200.         If CMDSTK987Cmds == "" Then Goto NEWCMD
  201.         CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, tab)
  202.         If CMDSTK987Now != "" Then Goto CMDDOIT
  203.    :NEWCMD
  204.         CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last)
  205.         If CMDSTK987Now == "" Then Goto PREVIOUS
  206.    :CMDDOIT
  207.         Execute Message(CMDSTK987Now, %CMDSTK987Now%)
  208.         if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,tab) then goto PREVIOUS
  209.         a=tab
  210.         if CMDSTK987Cmds=="" then a=""
  211.         CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now)
  212.         CMDSTK987Last = CMDSTK987Now
  213.         Goto PREVIOUS
  214.  
  215.    :FLUSH
  216.       If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = ""
  217.       Exit
  218. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  219. :FREESPACE
  220.         Drives=DiskScan(2)     ; 2 is the code for local hard drives
  221.         Dmax=strlen(Drives)
  222.         DIndex=1
  223.         TotalSize=0
  224.         DriveReport=""
  225.  
  226.         :COUNTSPACE
  227.         NextDrive=StrSub(Drives,Dindex,1)
  228.         a=DiskFree(NextDrive)/1024
  229.         TotalSize=a+TotalSize
  230.         DriveReport=strcat(DriveReport,NextDrive," = ",TAB,a,"K",TAB,strfill("|",(a+500)/1000),"@")
  231.         DIndex=Dindex+3  ;each entry is 3 bytes long
  232.         if DIndex<=Dmax then goto COUNTSPACE
  233.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  234.         Drop(TotalSize,DriveReport,Drives,NextDrive)
  235.         Exit
  236. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  237. :FILEINFO
  238.         CancelCmd="goto cancelfi"
  239.         a=FileItemize("")
  240.         if a=="" then a=FileItemize("*.*")
  241.         tot=FileSize(a)
  242.         c=ItemCount(a," ")
  243.         n=0
  244.         b=""
  245.         :ffloop
  246.         if n==c then goto ffshow
  247.         n=n+1
  248.         a1=StrFix(ItemExtract(n,a," ")," ",14)
  249.         a2=FileSize(a1)
  250.         a3=FileTimeGet(a1)
  251.         a4=FileAttrGet(a1)
  252.         b=strcat(b,a1,tab,a2,tab,a3,tab,a4,"|")
  253.         goto ffloop
  254.         :ffshow
  255.         ItemSelect("Total Size=%tot%",b,"|")
  256.         :cancelfi
  257.         drop(a,tot,c,n,a1,a2,a3,a4,b)
  258.         Exit
  259. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  260. :DIRSIZE
  261.         tot = FileSize(FileItemize(""))
  262.         sub1 = DirItemize("")
  263.         if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*"))
  264.                                 then sub1=DirItemize("*.*")
  265.         totdir=0
  266.         level=1
  267.         dir1=DirGet()
  268.         numdir1 = ItemCount(sub1, " ")
  269.         index1 = 0
  270.   
  271.         :dsloop
  272.         If index%level% == numdir%level% Then Goto upalevel
  273.         index%level% = index%level% + 1
  274.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  275.         totdir=totdir+1
  276.         tot = tot + FileSize(FileItemize("*.*"))
  277.         level = level + 1
  278.         dir%level% = DirGet()
  279.         sub%level% = DirItemize("*.*")
  280.         numdir%level% = ItemCount(sub%level%, " ")
  281.         index%level% = 0
  282.         goto dsloop
  283.   
  284.         :upalevel
  285.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  286.         level=level-1
  287.         if level!=0 then goto dsloop
  288.  
  289.         ; -----------
  290.         ; Termination
  291.         ; -----------
  292.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  293.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  294.         tot = StrTrim(tot)
  295.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  296.         tot = StrTrim(tot)
  297.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  298.         tot = StrTrim(tot)
  299.         Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  300.         drop(tot,level,totdir)
  301.         Exit
  302.  
  303. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  304. :FONEBOOK
  305.         ; This code implements a phone dialer with WIL language statements.
  306.         ; The phone numbers are kept in the FONEBOOK.TXT file.  It is simply a text
  307.         ; file with name followed by number.  This code assumes everything after the
  308.         ; last space is part of the phone number.
  309.  
  310.         ; The code also assumes that the COM port has been correctly set up in the
  311.         ; PORTS section of the control panel.  Mostly be sure the Control Panel
  312.         ; ports section has the right baud rate for your modem in it.
  313.  
  314.         ; User initialization section.  Set these to correspond to your modem commands.
  315.         ; Most users will only have to check the ComPort setting.
  316.  
  317.         CancelCmd="goto CancelFB"
  318.         FBCancelCmd="Exit"
  319.         ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI")
  320.         OldFont=99
  321.         XPort=ComPort
  322.         if ComPort=="ASK" then XPort=AskLine("Phone Book","Enter modem COM port.%CR%If you have problems dialing, verify%CR%COM port setting in Windows Control Panel","COM1")
  323.         if XPort=="" then exit
  324.         if XPort!=ComPort then IniWritePvt("FileCmdr","PhonePort",Xport,"WWW-PROD.INI")
  325.                           then ComPort=XPort
  326.  
  327.         DialPrefix="ATDT"
  328.         HangCommand="ATH0"
  329.  
  330.         ; And here we go.  First make a CR/LF and a TAB
  331.         CR=strcat(num2char(13),num2char(10))
  332.         TAB=num2char(9)
  333.  
  334.         ; Use Home Directory
  335.         DirChange(DirHome())
  336.         ; Make sure there is a fonebook.txt file
  337.         if !FileExist("FONEBOOK.TXT") then fp=FileOpen("FONEBOOK.TXT","WRITE")
  338.                                       then FileWrite(fp,"Emergency Services      911")
  339.                                       then FileWrite(fp,"Directory Assistance    1-555-1212")
  340.                                       then FileClose(fp)
  341.  
  342.  
  343.         ; Put up the TextBox so the user can choose a number
  344.         :NewNum
  345.         FBCancelCmd="Exit"                   ; What to do if user hits "Cancel"
  346.         OldFont=IntControl(28,1,0,0,0)     ;Select fixed pitch font for textbox
  347.         num=StrTrim(TextBoxSort("DIALER - Just hit OK to add a new number","fonebook.txt"))
  348.         IntControl(28,OldFont,0,0,0)
  349.         if num!="" then goto zorkle
  350.  
  351.  
  352.  
  353.         num=strtrim(AskLine("DIALER","Enter name and number as in%CR%(Don't put any spaces in the number)","Joe Blough  1-555-1212"))
  354.         Terminate(num=="","","")
  355.         a=StrIndex(num," ",0,@BACKSCAN)
  356.         num2=strsub(num,a+1,strlen(num)-a)
  357.         num=strtrim(strsub(num,1,a-1))
  358.         num=strcat(strfix(num,' ',25),num2)
  359.         fp=FileOpen("temp876.num","WRITE")
  360.         FileWrite(fp,num)       ; send it the number to dial
  361.         FileClose(fp)
  362.         FileAppend("temp876.num","fonebook.txt")
  363.         FileDelete("temp876.num")
  364.         goto newnum
  365.  
  366.         :zorkle
  367.         a=StrIndex(num," ",0,@BACKSCAN)
  368.         b=Strindex(num,TAB,0,@BACKSCAN)
  369.         a=max(a,b)
  370.         num=strsub(num,a+1,strlen(num)-a)
  371.         DialCommand="%DialPrefix%%NUM%;"
  372.  
  373.  
  374.         :redial
  375.         fp=FileOpen(ComPort,"WRITE")
  376.         FileWrite(fp,"ATZ")        ; Send a CR to wake modem up
  377.         Delay(2)                   ; Let it get out of bed.
  378.         FileWrite(fp,DialCommand)
  379.         FileClose(fp)
  380.         Delay(3)                   ; Give modem a chance to think
  381.  
  382.         FBCancelCmd="Goto Hang1"
  383.         a=AskYesNo("Dialer","Yes=HANGUP%CR%No=REDIAL%CR%Cancel=New Number")
  384.  
  385.         fp=FileOpen(ComPort,"WRITE")
  386.         FileWrite(fp,HangCommand)
  387.         FileClose(fp)
  388.  
  389.         if a==@YES then exit
  390.         Display(30,"Dialer","Redial Wait")
  391.         goto redial
  392.  
  393.         :CANCELFB
  394.         if OldFont!=99 then IntControl(28,OldFont,0,0,0)
  395.         %FBCancelCmd%
  396.  
  397.         :Hang1
  398.         fp=FileOpen(ComPort,"WRITE")
  399.         FileWrite(fp,HangCommand)
  400.         FileClose(fp)
  401.         goto NewNum
  402. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  403. :INIEDIT
  404.         DirChange(DirWindows(0))
  405.         CancelCmd="goto BYEBYE"
  406.         IniFiles=""
  407.         bSys386=0
  408.  
  409.         :UP1
  410.         CancelCmd="goto byebye"
  411.         If IniFiles!="" then goto inied
  412.         IniFiles=FileItemize("*.INI")
  413.         :inied
  414.         ButtonNames("&Edit File","&Quit")
  415.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  416.         if TheFile=="" then goto newini
  417.         Sections=""
  418.  
  419.         :UP2
  420.         CancelCmd="goto up1"
  421.         if Sections!="" then goto sected
  422.         Sections=IniItemizePvt("",TheFile)
  423.         :SECTED
  424.         ButtonNames("&Edit Section","&Up a Level")
  425.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  426.         if Section=="" then goto AddSect
  427.         if stricmp(Section,"386Enh")==0 then bSys386=1
  428.                                         else bSys386=0
  429.         KeyValues=""
  430.  
  431.         :UP3
  432.         CancelCmd="goto up2"
  433.         if KeyValues!="" then goto looped
  434.         Keys=IniItemizePvt(Section,TheFile)
  435.         if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","")
  436.                      then Keys=StrReplace(Keys,"Device%TAB%","")
  437.                      then Keys=StrReplace(Keys,"DEVICE%TAB%","")
  438.                      then Keys=StrReplace(Keys,"device","")
  439.                      then Keys=StrReplace(Keys,"Device","")
  440.                      then Keys=StrReplace(Keys,"DEVICE","")
  441.         KeyMax=ItemCount(Keys,TAB)
  442.         KeyIndex=0
  443.  
  444.         :ieLoop
  445.         if KeyIndex==KeyMax then goto looped
  446.         KeyIndex=KeyIndex+1
  447.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  448.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  449.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  450.         goto ieLoop
  451.  
  452.         :looped
  453.         ButtonNames("&Edit KeyWord","&Up a Level")
  454.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  455.         if Key=="" then goto AddKey
  456.         Key=ItemExtract(1,Key,"=")
  457.  
  458.         Value=IniReadPvt(Section,Key,"???",TheFile)
  459.         goto entkey
  460.  
  461.  
  462.         :newini
  463.         CancelCmd="goto UP1"
  464.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  465.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  466.         IniFiles=""
  467.         goto AddSectNewIni
  468.  
  469.         :AddSect
  470.         CancelCmd="goto up2"
  471.         :AddSectNewIni
  472.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  473.         Sections=""
  474.         goto AddKeyNewSect
  475.  
  476.         :AddKey
  477.         CancelCmd="goto up3"
  478.         :AddKeyNewSect
  479.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  480.         if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this utility")
  481.                                                  then goto AddKeyNewSect
  482.         Value="(Undefined)"
  483.         KeyValues=""
  484.         goto EntKeyNewKey
  485.  
  486.         :ENTKEY
  487.         CancelCmd="goto up3"
  488.         :EntKeyNewkey
  489.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  490.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  491.         KeyValues=""
  492.         goto up3
  493.  
  494.  
  495.         :BYEBYE
  496.         exit
  497. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  498. :SYSINFO
  499.        wintype="retail"
  500.        if WinMetrics(22) then wintype="debug"
  501.  
  502.         wc=WinConfig()
  503.         if !(wc&1) then mode="Real"
  504.         if wc&16 then mode="Standard"
  505.         if wc&32 then mode="Enhanced"
  506.  
  507.         if wc&2 then cpu=286
  508.         if wc&4 then cpu=386
  509.         if wc&8 then cpu=486
  510.         if wc&64 then cpu=8086
  511.         if wc&128 then cpu=80186
  512.  
  513.         Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
  514.  
  515.         math="No math"
  516.         if wc&1024 then math="Math"
  517.         mouse="No Mouse"
  518.         if WinMetrics(19) then mouse="Mouse"
  519.  
  520.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  521.  
  522.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  523.  
  524.         ErrorMode(@OFF)
  525.         LastError()
  526.         PlayMedia("Status WaveForm Ready")
  527.         ErrorMode(@CANCEL)
  528.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  529.  
  530.         bug=NetGetCaps(2)
  531.         if bug==0 then math="No n"
  532.         if bug!=0 then math="N"
  533.         if bug==256 then math="Microsoft n"
  534.         if bug==512 then math="Lan Manager n"
  535.         if bug==768 then math="Novell NetWare n"
  536.         if bug==1024 then math="Banyan Vines n"
  537.         if bug==1280 then math="10 Net n"
  538.         sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
  539.  
  540.         bug=WinResources(0)/1024   ; Compute memory avail
  541.         math=strlen(bug)
  542.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  543.  
  544.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  545.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  546.  
  547.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  548.         disks=DiskScan(1)
  549.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  550.         disks=DiskScan(2)
  551.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  552.         disks=DiskScan(4)
  553.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  554.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  555.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  556.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  557.  
  558.         ver=Version()
  559.         Message("%Param2% %ver% SysInfo",Sysinfo)
  560.         Exit
  561.  
  562. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  563. :ZIP
  564. :UNZIP
  565.     CancelCommand="goto ZZCANCEL"
  566.     ErrMsg=""
  567.     If !FileExist("wwwdos.bat")   Then ErrMsg="WWWDOS.BAT   not found"
  568.     If !FileExist("wwwdosp.pif")  Then ErrMsg="WWWDOSP.PIF  not found"
  569.     If !FileExist("wwwdosc.pif")  Then ErrMsg="WWWDOSC.PIF  not found"
  570.     If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found"
  571.     If !FileExist("pkzip.exe")    Then ErrMsg="PKZIP.EXE    not found"
  572.     If !FileExist("pkunzip.exe")  Then ErrMsg="PKUNZIP.EXE  not found"
  573.     If !FileExist("browser.exe")  Then ErrMsg="BROWSER.EXE  not found"
  574.     If ErrMsg!="" Then Goto ShowError
  575.  
  576.         goto %param1%2     ; must be ZIP or UNZIP
  577.  
  578. :ZIP2
  579.         DaMove=" -a "
  580.         DaDirs=""
  581.         DaWho="*.*"
  582.         DaZip=""
  583.         DaRefresh=0
  584.         DaTitle="Files"
  585.         param3=strlower(param3)
  586.         if param3=="move" then DaMove=" -m "
  587.         goto %param2%         ; Must be CURRENT, DIR, SUBDIR, or HILITED
  588.  
  589. :CURRENT
  590.         DaWho=strcat(CurrentPath(),CurrentFile())
  591.         DaZip=strcat(FileRoot(DaWho),".ZIP")
  592.         goto ZIPDO
  593. :SUBDIR
  594.        DaDirs=" -r -p "
  595.        DaRefresh=1
  596.        DaTitle="Structure"
  597.        goto ZIPDO
  598.  
  599. :HILITED
  600.         b=FileItemize("")
  601.         If b=="" Then ErrMsg="Zip Hilited files?  No files hilited!"
  602.                  Then Goto ShowError
  603.         b=strreplace(b," ",CR)
  604.         fp=FileOpen("FC-TEMP9.XCV","WRITE")
  605.         FileWrite(fp,b)
  606.         FileClose(fp)
  607.         Drop(b)
  608.         DaWho="@FC-TEMP9.XCV"
  609.         goto ZIPDO
  610.  
  611. :DIR
  612.        DaTitle="Directory"
  613.        goto ZIPDO
  614.  
  615. :ZIPDO
  616.         DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip)
  617.         if DaZip=="" then goto zzcancel
  618.         Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%")
  619.         if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho)
  620.         Refresh(DaRefresh)
  621.         Display(3,"Zip %DaTitle%","Complete")
  622.         goto zzcancel
  623.  
  624. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  625. :UNZIP2
  626.  
  627.        ViewFlag=0
  628.        zipsort=param3
  629.        goto %param2%    ; must be ALL, VIEW, or INDIV
  630.  
  631. :ALL
  632.         zipfile=strcat(CurrentPath(),CurrentFile())
  633.         if FileExtension(zipfile)=="ZIP" then goto alldoit
  634.         zipfile=FileItemize("*.zip")
  635.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  636.                  Then Goto ShowError
  637.         zipfile=itemselect("Select file to UnZip",zipfile," ")
  638.         if zipfile=="" then goto zzcancel
  639. :alldoit
  640.         if param3==2 then goto allspec
  641.         runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%")
  642.         Refresh(1)
  643.         goto zzcancel
  644.  
  645. :allspec
  646.         RetHome="allspec1"
  647.         goto DoOptions
  648. :allspec1
  649.         if overwarn==0 then overwarn=" -o "
  650.                        else overwarn=""
  651.         RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*")
  652.         Refresh(1)
  653.         goto zzcancel
  654.  
  655.  
  656.  
  657. :INDIV
  658.        ViewFlag=param3
  659.        if ViewFlag==1 then zipsort=1
  660.                       then overwarn=0
  661.                       then targdir=""
  662.                       then goto VIEW
  663.  
  664.         RetHome="VIEW"
  665.         goto DoOptions
  666.  
  667. :VIEW
  668.         workdir = Environment("TEMP")
  669.         If workdir == "" Then workdir = DirWindows(0)
  670.         If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\")
  671.         if ViewFlag==0 then targdir=workdir
  672.         zipfile=strcat(CurrentPath(),CurrentFile())
  673.         if FileExtension(zipfile)=="ZIP" then goto viewdoit
  674.         zipfile=FileItemize("*.zip")
  675.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  676.                  Then Goto ShowError
  677.         if ViewFlag==0 then TSMsg="Select ZIP file to view"
  678.                        else TSMsg="Select ZIP file to use"
  679.         zipfile=itemselect(TSMsg,zipfile," ")
  680.         if zipfile=="" then goto zzcancel
  681.  
  682. :viewdoit
  683.         ziplist = StrCat(workdir, "wwwunzip.lst")
  684.         If FileExist(ziplist) Then FileDelete(ziplist)
  685.  
  686.         RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%")
  687.         if ViewFlag==0 then TSMsg="Select file to view"
  688.                        else TSMsg="Select file to extract"
  689. :TXSEL
  690.         OldFont=IntControl(28,1,0,0,0)        ; Set fixed pitch font in text box
  691.         member=TextBox(TSMsg,ziplist)
  692.         IntControl(28,OldFont,0,0,0)          ; Restore previous font pitch type
  693.         if member=="" then goto ZZCANCEL
  694.  
  695.         member=strsub(member,46,strlen(member)-45)
  696.         memfile=FileExtension(member)
  697.         if memfile!="" then memfile=strcat(FileRoot(member),".",memfile)
  698.                        else memfile=FileRoot(member)
  699.         
  700.  
  701.         if ViewFlag==0 then goto extract
  702.         if overwarn==0 then goto extract
  703.         If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract
  704.         b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?")
  705.         If b == @NO Then Goto TXSEL
  706.  
  707. :extract
  708.         RunHideWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%")
  709.         If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file"
  710.                                            Then Goto ShowError
  711.  
  712.         if ViewFlag!=0 then TSMsg="Extract Another?"
  713.                        then goto TXSEL
  714.         member = StrUpper(StrCat(targdir, memfile))
  715.         RunZoomWait("browser.exe", member)
  716.         FileDelete(member)
  717.         TSMsg="View Another?"
  718.         goto TXSEL
  719.  
  720.  
  721. :SHOWERROR
  722.     Message("Error", ErrMsg)
  723.  
  724. :ZZCANCEL
  725.     if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist)
  726.     Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort)
  727.     Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member)
  728.     Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile)
  729.     Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight)
  730.     Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06)
  731.     Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13)
  732.     exit
  733. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  734.  
  735. :DOOPTIONS
  736.         zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini")
  737.         overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini")
  738.         whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini")
  739.  
  740.         ; Undocumented, new, beta dialog function being used here.  Will
  741.         ; be documented in the 2.0 release.  Good Luck.
  742.  
  743.  
  744.         ZippyFormat=`WWWDLGED,4.0`
  745.  
  746.         ZippyCaption=`Zip Options`
  747.     ZippyX=-1
  748.     ZippyY=-1
  749.     ZippyWidth=217
  750.     ZippyHeight=115
  751.     ZippyNumControls=13
  752.     Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1`
  753.     Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2`
  754.     Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""`
  755.     Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1`
  756.     Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2`
  757.     Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3`
  758.     Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4`
  759.     Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1`
  760.  
  761.     Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  762.     Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  763.     Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"`
  764.     Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"`
  765.     Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""`
  766.  
  767.  
  768. :gettarg
  769.         ; Undocumented, new, beta dialog function being used here.  Will
  770.         ; be documented in the 2.0 release.  Good Luck.
  771.         ThisDir=DirGet()
  772.         targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini")
  773.         Dialog("Zippy")
  774.  
  775.         if whichdir==1 then usecurdir = @YES
  776.                        then targdir=ThisDir
  777.                        else usecurdir = @NO
  778.         targdir = StrUpper(targdir)
  779.         If targdir == "" Then usecurdir = @YES
  780.                          Then targdir = DirGet()
  781.         If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\")
  782.         If ThisDir==targdir then usecurdir = @YES
  783.                             then goto targok
  784.         DirChange(targdir)
  785.         CheckDir=DirGet()
  786.         DirChange(ThisDir)
  787.         If ThisDir!=CheckDir Then Goto targok
  788.  
  789.         b= AskYesNo("WWWUNZIP", "%targdir% does not exist.  Do you wish to create it?")
  790.         If b == @NO Then Goto gettarg
  791.         DirMake(targdir)
  792.         DirChange(targdir)
  793.         CheckDir=DirGet()
  794.         DirChange(ThisDir)
  795.         If ThisDir!=CheckDir Then Goto targok
  796.         Message("WWWUNZIP","%targdir% could not be created.  Please respecify.")
  797.         goto gettarg
  798.  
  799.         :targok
  800.         If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini")
  801.         IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini")
  802.         IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini")
  803.         IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini")
  804.         goto %RetHome%
  805. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  806. :CANCEL        ; This cancel is shared by ALL the above routines.
  807. %CancelCmd%    ; Execute Cancel Command
  808.